package com.playball.lottery.frm.buyhall;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.playball.lottery.R;
import com.playball.lottery.base.BaseActivity;
import com.playball.lottery.customview.ChildDTO;
import com.playball.lottery.customview.MyDialog;
import com.playball.lottery.util.DefConstants;


public class JczqHhtz extends BaseActivity implements DefConstants {

	TextView tv_wkname;
	View v_spf;
	View v_rqspf;
	View v_bqc;
	View v_zjq;
	View v_bf;

	Button btn_spf_zs;
	Button btn_spf_p;
	Button btn_spf_zf;
	Button btn_rqspf_zs;
	Button btn_rqspf_p;
	Button btn_rqspf_zf;

	Button btn_bqc_ss;
	Button btn_bqc_sp;
	Button btn_bqc_sf;
	Button btn_bqc_ps;
	Button btn_bqc_pp;
	Button btn_bqc_pf;
	Button btn_bqc_fs;
	Button btn_bqc_fp;
	Button btn_bqc_ff;

	Button btn_zjq0;
	Button btn_zjq1;
	Button btn_zjq2;
	Button btn_zjq3;
	Button btn_zjq4;
	Button btn_zjq5;
	Button btn_zjq6;
	Button btn_zjq7;

	Button btn_bf_s10;
	Button btn_bf_s20;
	Button btn_bf_s21;
	Button btn_bf_s30;
	Button btn_bf_s31;
	Button btn_bf_s32;
	Button btn_bf_s40;
	Button btn_bf_s41;
	Button btn_bf_s42;
	Button btn_bf_s50;
	Button btn_bf_s51;
	Button btn_bf_s52;
	Button btn_bf_sqt;

	Button btn_bf_p00;
	Button btn_bf_p11;
	Button btn_bf_p22;
	Button btn_bf_p33;
	Button btn_bf_pqt;

	Button btn_bf_f01;
	Button btn_bf_f02;
	Button btn_bf_f12;
	Button btn_bf_f03;
	Button btn_bf_f13;
	Button btn_bf_f23;
	Button btn_bf_f04;
	Button btn_bf_f14;
	Button btn_bf_f24;
	Button btn_bf_f05;
	Button btn_bf_f15;
	Button btn_bf_f25;
	Button btn_bf_fqt;

	Button btn_ok;
	Button btn_cancel;

	// TextView tv_rf;
	// TextView tv_base_score;
	TextView tvRqspfName;

	static ChildDTO childDTO;

	int gInd = 0;
	int cInd = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.buy_jczq_hhtz);
		Intent intent = getIntent();
		childDTO = (ChildDTO) intent.getSerializableExtra("info");
		String wkName = intent.getStringExtra("wk").substring(0, 2);
		gInd = intent.getIntExtra("gindex", 0);
		cInd = intent.getIntExtra("cindex", 0);

		v_spf = findViewById(R.id.hhtz_spf);
		v_rqspf = findViewById(R.id.hhtz_rqspf);
		v_bqc = findViewById(R.id.hhtz_bqc);
		v_zjq = findViewById(R.id.hhtz_zjq);
		v_bf = findViewById(R.id.hhtz_bf);
		// gggg
		// tv_base_score = (TextView) findViewById(R.id.dxf_score);
		// tv_rf = (TextView) findViewById(R.id.rfsfrf);
		tvRqspfName = (TextView) findViewById(R.id.textViewRqspfName);
		tv_wkname = (TextView) findViewById(R.id.textView1);
		btn_spf_zf = (Button) findViewById(R.id.hhtz_spf_zf);
		btn_spf_p = (Button) findViewById(R.id.hhtz_spf_p);
		btn_spf_zs = (Button) findViewById(R.id.hhtz_spf_zs);
		btn_rqspf_zf = (Button) findViewById(R.id.hhtz_rqspf_zf);
		btn_rqspf_p = (Button) findViewById(R.id.hhtz_rqspf_p);
		btn_rqspf_zs = (Button) findViewById(R.id.hhtz_rqspf_zs);

		btn_bqc_ss = (Button) findViewById(R.id.hhtz_bqc_ss);
		btn_bqc_sp = (Button) findViewById(R.id.hhtz_bqc_sp);
		btn_bqc_sf = (Button) findViewById(R.id.hhtz_bqc_sf);
		btn_bqc_ps = (Button) findViewById(R.id.hhtz_bqc_ps);
		btn_bqc_pp = (Button) findViewById(R.id.hhtz_bqc_pp);
		btn_bqc_pf = (Button) findViewById(R.id.hhtz_bqc_pf);
		btn_bqc_fs = (Button) findViewById(R.id.hhtz_bqc_fs);
		btn_bqc_fp = (Button) findViewById(R.id.hhtz_bqc_fp);
		btn_bqc_ff = (Button) findViewById(R.id.hhtz_bqc_ff);

		btn_zjq0 = (Button) findViewById(R.id.hhtz_zjq0);
		btn_zjq1 = (Button) findViewById(R.id.hhtz_zjq1);
		btn_zjq2 = (Button) findViewById(R.id.hhtz_zjq2);
		btn_zjq3 = (Button) findViewById(R.id.hhtz_zjq3);
		btn_zjq4 = (Button) findViewById(R.id.hhtz_zjq4);
		btn_zjq5 = (Button) findViewById(R.id.hhtz_zjq5);
		btn_zjq6 = (Button) findViewById(R.id.hhtz_zjq6);
		btn_zjq7 = (Button) findViewById(R.id.hhtz_zjq7);

		btn_bf_s10 = (Button) findViewById(R.id.hhtz_bf_s10);
		btn_bf_s20 = (Button) findViewById(R.id.hhtz_bf_s20);
		btn_bf_s21 = (Button) findViewById(R.id.hhtz_bf_s21);
		btn_bf_s30 = (Button) findViewById(R.id.hhtz_bf_s30);
		btn_bf_s31 = (Button) findViewById(R.id.hhtz_bf_s31);
		btn_bf_s32 = (Button) findViewById(R.id.hhtz_bf_s32);
		btn_bf_s40 = (Button) findViewById(R.id.hhtz_bf_s40);
		btn_bf_s41 = (Button) findViewById(R.id.hhtz_bf_s41);
		btn_bf_s42 = (Button) findViewById(R.id.hhtz_bf_s42);
		btn_bf_s50 = (Button) findViewById(R.id.hhtz_bf_s50);
		btn_bf_s51 = (Button) findViewById(R.id.hhtz_bf_s51);
		btn_bf_s52 = (Button) findViewById(R.id.hhtz_bf_s52);
		btn_bf_sqt = (Button) findViewById(R.id.hhtz_bf_sqt);

		btn_bf_p00 = (Button) findViewById(R.id.hhtz_bf_p00);
		btn_bf_p11 = (Button) findViewById(R.id.hhtz_bf_p11);
		btn_bf_p22 = (Button) findViewById(R.id.hhtz_bf_p22);
		btn_bf_p33 = (Button) findViewById(R.id.hhtz_bf_p33);
		btn_bf_pqt = (Button) findViewById(R.id.hhtz_bf_pqt);

		btn_bf_f01 = (Button) findViewById(R.id.hhtz_bf_f01);
		btn_bf_f02 = (Button) findViewById(R.id.hhtz_bf_f02);
		btn_bf_f12 = (Button) findViewById(R.id.hhtz_bf_f12);
		btn_bf_f03 = (Button) findViewById(R.id.hhtz_bf_f03);
		btn_bf_f13 = (Button) findViewById(R.id.hhtz_bf_f13);
		btn_bf_f23 = (Button) findViewById(R.id.hhtz_bf_f23);
		btn_bf_f04 = (Button) findViewById(R.id.hhtz_bf_f04);
		btn_bf_f14 = (Button) findViewById(R.id.hhtz_bf_f14);
		btn_bf_f24 = (Button) findViewById(R.id.hhtz_bf_f24);
		btn_bf_f05 = (Button) findViewById(R.id.hhtz_bf_f05);
		btn_bf_f15 = (Button) findViewById(R.id.hhtz_bf_f15);
		btn_bf_f25 = (Button) findViewById(R.id.hhtz_bf_f25);
		btn_bf_fqt = (Button) findViewById(R.id.hhtz_bf_fqt);

		btn_ok = (Button) findViewById(R.id.hhtz_jczq_ok);
		btn_cancel = (Button) findViewById(R.id.hhtz_jczq_cancel);

		final String spf = childDTO.getsPspf();
		String rqspf = childDTO.getsPRqspf();
		String bqc = childDTO.getsPbqc();
		String zjq = childDTO.getsPzjq();
		String bf = childDTO.getsPbf();
		System.out.println("12121:"+bf);
		tv_wkname.setText(wkName + (childDTO.mId).substring(6) + "  " + childDTO.hTeam + "VS" + childDTO.vTeam);
		if (TextUtils.isEmpty(spf)) {
			v_spf.setVisibility(View.GONE);
		} else if ((spf.split("\\|")).length >= 3) {
			btn_spf_zf.setText(Html.fromHtml("<b>负</b>  <font size='10dip' color='#0163bf'>" + (spf.split("\\|"))[2]
					+ "</font>"));
			btn_spf_zf.setTag(spf.split("\\|")[2]);// sp值存入button的tag，记录投注选项的sp值，为下面计算奖金使用
			btn_spf_p.setText(Html.fromHtml("<b>平</b>  <font size='10dip' color='#0163bf'>" + (spf.split("\\|"))[1]
					+ "</font>"));
			btn_spf_p.setTag((spf.split("\\|"))[1]);
			btn_spf_zs.setText(Html.fromHtml("<b>胜</b>  <font size='10dip' color='#0163bf'>" + (spf.split("\\|"))[0]
					+ "</font>"));
			btn_spf_zs.setTag((spf.split("\\|"))[0]);
		} else {
			v_spf.setVisibility(View.GONE);
		}

		if (TextUtils.isEmpty(rqspf)) {
			v_rqspf.setVisibility(View.GONE);
		} else if ((rqspf.split("\\|")).length >= 3) {
			String rq = childDTO.geteQ();
			if (!rq.equals("")) {
				if (!rq.startsWith("-")) {
					rq = "+" + rq;
				}
			}

			// Log.e("jclqHhtz", "oncreate rq= "+rq);
			tvRqspfName.setText("让球" + rq + "\n胜平负");
			btn_rqspf_zf.setText(Html.fromHtml("<b>负</b>  <font size='10dip' color='#0163bf'>"
					+ (rqspf.split("\\|"))[2] + "</font>"));
			btn_rqspf_zf.setTag((rqspf.split("\\|"))[2]);
			btn_rqspf_p.setText(Html.fromHtml("<b>平</b>  <font size='10dip' color='#0163bf'>" + (rqspf.split("\\|"))[1]
					+ "</font>"));
			btn_rqspf_p.setTag((rqspf.split("\\|"))[1]);
			btn_rqspf_zs.setText(Html.fromHtml("<b>胜</b>  <font size='10dip' color='#0163bf'>"
					+ (rqspf.split("\\|"))[0] + "</font>"));
			btn_rqspf_zs.setTag((rqspf.split("\\|"))[0]);
		}

		if (TextUtils.isEmpty(bqc)) {
			v_bqc.setVisibility(View.GONE);
		} else if ((bqc.split("\\|")).length >= 9) {
			btn_bqc_ss.setText(Html.fromHtml("<b>胜胜</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[8] + "</font>"));
			btn_bqc_ss.setTag((bqc.split("\\|"))[8]);

			btn_bqc_sp.setText(Html.fromHtml("<b>胜平</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[7] + "</font>"));
			btn_bqc_sp.setTag((bqc.split("\\|"))[7]);
			btn_bqc_sf.setText(Html.fromHtml("<b>胜负</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[6] + "</font>"));
			btn_bqc_sf.setTag((bqc.split("\\|"))[6]);
			btn_bqc_ps.setText(Html.fromHtml("<b>平胜</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[5] + "</font>"));
			btn_bqc_ps.setTag((bqc.split("\\|"))[5]);

			btn_bqc_pp.setText(Html.fromHtml("<b>平平</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[4] + "</font>"));
			btn_bqc_pp.setTag((bqc.split("\\|"))[4]);
			btn_bqc_pf.setText(Html.fromHtml("<b>平负</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[3] + "</font>"));
			btn_bqc_pf.setTag((bqc.split("\\|"))[3]);
			btn_bqc_fs.setText(Html.fromHtml("<b>负胜</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[2] + "</font>"));
			btn_bqc_fs.setTag((bqc.split("\\|"))[2]);

			btn_bqc_fp.setText(Html.fromHtml("<b>负平</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[1] + "</font>"));
			btn_bqc_fp.setTag((bqc.split("\\|"))[1]);
			btn_bqc_ff.setText(Html.fromHtml("<b>负负</b> <br> <font size='10dip' color='#0163bf'>"
					+ (bqc.split("\\|"))[0] + "</font>"));
			btn_bqc_ff.setTag((bqc.split("\\|"))[0]);
		}

		if (TextUtils.isEmpty(zjq)) {
			v_zjq.setVisibility(View.GONE);
		} else if ((zjq.split("\\|")).length >= 8) {
			String[] zjqargs = zjq.split("\\|");
			btn_zjq0.setText(Html.fromHtml("<b>0</b><br><font size='10dip' color='#0163bf'>" + zjqargs[0] + "</font>"));
			btn_zjq0.setTag(zjqargs[0]);
			btn_zjq1.setText(Html.fromHtml("<b>1</b><br><font size='10dip' color='#0163bf'>" + zjqargs[1] + "</font>"));
			btn_zjq1.setTag(zjqargs[1]);
			btn_zjq2.setText(Html.fromHtml("<b>2</b><br><font size='10dip' color='#0163bf'>" + zjqargs[2] + "</font>"));
			btn_zjq2.setTag(zjqargs[2]);
			btn_zjq3.setText(Html.fromHtml("<b>3</b><br><font size='10dip' color='#0163bf'>" + zjqargs[3] + "</font>"));
			btn_zjq3.setTag(zjqargs[3]);
			btn_zjq4.setText(Html.fromHtml("<b>4</b><br><font size='10dip' color='#0163bf'>" + zjqargs[4] + "</font>"));
			btn_zjq4.setTag(zjqargs[4]);
			btn_zjq5.setText(Html.fromHtml("<b>5</b><br><font size='10dip' color='#0163bf'>" + zjqargs[5] + "</font>"));
			btn_zjq5.setTag(zjqargs[5]);
			btn_zjq6.setText(Html.fromHtml("<b>6</b><br><font size='10dip' color='#0163bf'>" + zjqargs[6] + "</font>"));
			btn_zjq6.setTag(zjqargs[6]);
			btn_zjq7.setText(Html.fromHtml("<b>7+</b><br><font size='10dip' color='#0163bf'>" + zjqargs[7] + "</font>"));
			btn_zjq7.setTag(zjqargs[7]);
		}
		if (TextUtils.isEmpty(bf)) {
			v_bf.setVisibility(View.GONE);
		} else if ((bf.split("\\|")).length >= 31) {
			String[] bfargs = bf.split("\\|");
			btn_bf_s10.setText(Html.fromHtml("<b>1:0</b><br><font size='10dip' color='#0163bf'>" + bfargs[0]
					+ "</font>"));
			btn_bf_s10.setTag(bfargs[0]);
			btn_bf_s20.setText(Html.fromHtml("<b>2:0</b><br><font size='10dip' color='#0163bf'>" + bfargs[1]
					+ "</font>"));
			btn_bf_s20.setTag(bfargs[1]);
			btn_bf_s21.setText(Html.fromHtml("<b>2:1</b><br><font size='10dip' color='#0163bf'>" + bfargs[2]
					+ "</font>"));
			btn_bf_s21.setTag(bfargs[2]);
			btn_bf_s30.setText(Html.fromHtml("<b>3:0</b><br><font size='10dip' color='#0163bf'>" + bfargs[3]
					+ "</font>"));
			btn_bf_s30.setTag(bfargs[3]);
			btn_bf_s31.setText(Html.fromHtml("<b>3:1</b><br><font size='10dip' color='#0163bf'>" + bfargs[4]
					+ "</font>"));
			btn_bf_s31.setTag(bfargs[4]);
			btn_bf_s32.setText(Html.fromHtml("<b>3:2</b><br><font size='10dip' color='#0163bf'>" + bfargs[5]
					+ "</font>"));
			btn_bf_s32.setTag(bfargs[5]);
			btn_bf_s40.setText(Html.fromHtml("<b>4:0</b><br><font size='10dip' color='#0163bf'>" + bfargs[6]
					+ "</font>"));
			btn_bf_s40.setTag(bfargs[6]);
			btn_bf_s41.setText(Html.fromHtml("<b>4:1</b><br><font size='10dip' color='#0163bf'>" + bfargs[7]
					+ "</font>"));
			btn_bf_s41.setTag(bfargs[7]);
			btn_bf_s42.setText(Html.fromHtml("<b>4:2</b><br><font size='10dip' color='#0163bf'>" + bfargs[8]
					+ "</font>"));
			btn_bf_s42.setTag(bfargs[8]);
			btn_bf_s50.setText(Html.fromHtml("<b>5:0</b><br><font size='10dip' color='#0163bf'>" + bfargs[9]
					+ "</font>"));
			btn_bf_s50.setTag(bfargs[9]);
			btn_bf_s51.setText(Html.fromHtml("<b>5:1</b><br><font size='10dip' color='#0163bf'>" + bfargs[10]
					+ "</font>"));
			btn_bf_s51.setTag(bfargs[10]);
			btn_bf_s52.setText(Html.fromHtml("<b>5:2</b><br><font size='10dip' color='#0163bf'>" + bfargs[11]
					+ "</font>"));
			btn_bf_s52.setTag(bfargs[11]);
			btn_bf_sqt.setText(Html.fromHtml("<b>胜其他</b><br><font size='10dip' color='#0163bf'>" + bfargs[12]
					+ "</font>"));
			btn_bf_sqt.setTag(bfargs[12]);

			btn_bf_p00.setText(Html.fromHtml("<b>0:0</b><br><font size='10dip' color='#0163bf'>" + bfargs[13]
					+ "</font>"));
			btn_bf_p00.setTag(bfargs[13]);
			btn_bf_p11.setText(Html.fromHtml("<b>1:1</b><br><font size='10dip' color='#0163bf'>" + bfargs[14]
					+ "</font>"));
			btn_bf_p11.setTag(bfargs[14]);
			btn_bf_p22.setText(Html.fromHtml("<b>2:2</b><br><font size='10dip' color='#0163bf'>" + bfargs[15]
					+ "</font>"));
			btn_bf_p22.setTag(bfargs[15]);
			btn_bf_p33.setText(Html.fromHtml("<b>3:3</b><br><font size='10dip' color='#0163bf'>" + bfargs[16]
					+ "</font>"));
			btn_bf_p33.setTag(bfargs[16]);
			btn_bf_pqt.setText(Html.fromHtml("<b>平其他</b><br><font size='10dip' color='#0163bf'>" + bfargs[17]
					+ "</font>"));
			btn_bf_pqt.setTag(bfargs[17]);

			btn_bf_f01.setText(Html.fromHtml("<b>0:1</b><br><font size='10dip' color='#0163bf'>" + bfargs[18]
					+ "</font>"));
			btn_bf_f01.setTag(bfargs[18]);
			btn_bf_f02.setText(Html.fromHtml("<b>0:2</b><br><font size='10dip' color='#0163bf'>" + bfargs[19]
					+ "</font>"));
			btn_bf_f02.setTag(bfargs[19]);
			btn_bf_f12.setText(Html.fromHtml("<b>1:2</b><br><font size='10dip' color='#0163bf'>" + bfargs[20]
					+ "</font>"));
			btn_bf_f12.setTag(bfargs[20]);
			btn_bf_f03.setText(Html.fromHtml("<b>0:3</b><br><font size='10dip' color='#0163bf'>" + bfargs[21]
					+ "</font>"));
			btn_bf_f03.setTag(bfargs[21]);
			btn_bf_f13.setText(Html.fromHtml("<b>1:3</b><br><font size='10dip' color='#0163bf'>" + bfargs[22]
					+ "</font>"));
			btn_bf_f13.setTag(bfargs[22]);
			btn_bf_f23.setText(Html.fromHtml("<b>2:3</b><br><font size='10dip' color='#0163bf'>" + bfargs[23]
					+ "</font>"));
			btn_bf_f23.setTag(bfargs[23]);
			btn_bf_f04.setText(Html.fromHtml("<b>0:4</b><br><font size='10dip' color='#0163bf'>" + bfargs[24]
					+ "</font>"));
			btn_bf_f04.setTag(bfargs[24]);
			btn_bf_f14.setText(Html.fromHtml("<b>1:4</b><br><font size='10dip' color='#0163bf'>" + bfargs[25]
					+ "</font>"));
			btn_bf_f14.setTag(bfargs[25]);
			btn_bf_f24.setText(Html.fromHtml("<b>2:4</b><br><font size='10dip' color='#0163bf'>" + bfargs[26]
					+ "</font>"));
			btn_bf_f24.setTag(bfargs[26]);
			btn_bf_f05.setText(Html.fromHtml("<b>0:5</b><br><font size='10dip' color='#0163bf'>" + bfargs[27]
					+ "</font>"));
			btn_bf_f05.setTag(bfargs[27]);
			btn_bf_f15.setText(Html.fromHtml("<b>1:5</b><br><font size='10dip' color='#0163bf'>" + bfargs[28]
					+ "</font>"));
			btn_bf_f15.setTag(bfargs[28]);
			btn_bf_f25.setText(Html.fromHtml("<b>2:5</b><br><font size='10dip' color='#0163bf'>" + bfargs[29]
					+ "</font>"));
			btn_bf_f25.setTag(bfargs[29]);
			btn_bf_fqt.setText(Html.fromHtml("<b>负其他</b><br><font size='10dip' color='#0163bf'>" + bfargs[30]
					+ "</font>"));
			btn_bf_fqt.setTag(bfargs[30]);

		}

		btn_spf_zf.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_spf_zf.isSelected() == true) {
					btn_spf_zf.setSelected(false);
					// System.out.println("btn_sf_zf.setOnClickListener:d-" +
					// childDTO.hhtzzq1);
					childDTO.hhtzzq1 = childDTO.hhtzzq1.replace("0", "");
					// System.out.println("btn_sf_zf.setOnClickListener:d-" +
					// childDTO.hhtzzq1);
				} else {
					btn_spf_zf.setSelected(true);
					// System.out.println("btn_sf_zf.setOnClickListener:a-" +
					// childDTO.hhtzzq1);
					childDTO.hhtzzq1 += "0";
					// System.out.println("btn_sf_zf.setOnClickListener:a-" +
					// childDTO.hhtzzq1);
				}
			}
		});

		btn_spf_p.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_spf_p.isSelected() == true) {
					btn_spf_p.setSelected(false);
					childDTO.hhtzzq1 = childDTO.hhtzzq1.replace("1", "");
				} else {
					btn_spf_p.setSelected(true);
					childDTO.hhtzzq1 += "1";
				}
			}
		});

		btn_spf_zs.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_spf_zs.isSelected() == true) {
					btn_spf_zs.setSelected(false);
					childDTO.hhtzzq1 = childDTO.hhtzzq1.replace("3", "");
				} else {
					btn_spf_zs.setSelected(true);
					childDTO.hhtzzq1 += "3";
				}
			}
		});

		btn_rqspf_zf.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_rqspf_zf.isSelected() == true) {
					btn_rqspf_zf.setSelected(false);
					childDTO.hhtzzq2 = childDTO.hhtzzq2.replace("0", "");
				} else {
					btn_rqspf_zf.setSelected(true);
					childDTO.hhtzzq2 += "0";
				}
			}
		});

		btn_rqspf_p.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_rqspf_p.isSelected() == true) {
					btn_rqspf_p.setSelected(false);
					childDTO.hhtzzq2 = childDTO.hhtzzq2.replace("1", "");
				} else {
					btn_rqspf_p.setSelected(true);
					childDTO.hhtzzq2 += "1";
				}
			}
		});

		btn_rqspf_zs.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_rqspf_zs.isSelected() == true) {
					btn_rqspf_zs.setSelected(false);
					childDTO.hhtzzq2 = childDTO.hhtzzq2.replace("3", "");
				} else {
					btn_rqspf_zs.setSelected(true);
					childDTO.hhtzzq2 += "3";
				}
			}
		});

		btn_bqc_ss.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_ss.isSelected() == true) {
					btn_bqc_ss.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("a", "");
				} else {
					btn_bqc_ss.setSelected(true);
					childDTO.hhtzzq3 += "a";// a b c ,d e f ,g h i
				}
			}
		});
		btn_bqc_sp.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_sp.isSelected() == true) {
					btn_bqc_sp.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("b", "");
				} else {
					btn_bqc_sp.setSelected(true);
					childDTO.hhtzzq3 += "b";
				}
			}
		});
		btn_bqc_sf.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_sf.isSelected() == true) {
					btn_bqc_sf.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("c", "");
				} else {
					btn_bqc_sf.setSelected(true);
					childDTO.hhtzzq3 += "c";
				}
			}
		});

		btn_bqc_ps.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_ps.isSelected() == true) {
					btn_bqc_ps.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("d", "");
				} else {
					btn_bqc_ps.setSelected(true);
					childDTO.hhtzzq3 += "d";
				}
			}
		});
		btn_bqc_pp.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_pp.isSelected() == true) {
					btn_bqc_pp.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("e", "");
				} else {
					btn_bqc_pp.setSelected(true);
					childDTO.hhtzzq3 += "e";
				}
			}
		});
		btn_bqc_pf.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_pf.isSelected() == true) {
					btn_bqc_pf.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("f", "");
				} else {
					btn_bqc_pf.setSelected(true);
					childDTO.hhtzzq3 += "f";
				}
			}
		});

		btn_bqc_fs.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_fs.isSelected() == true) {
					btn_bqc_fs.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("g", "");
				} else {
					btn_bqc_fs.setSelected(true);
					childDTO.hhtzzq3 += "g";
				}
			}
		});
		btn_bqc_fp.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_fp.isSelected() == true) {
					btn_bqc_fp.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("h", "");
				} else {
					btn_bqc_fp.setSelected(true);
					childDTO.hhtzzq3 += "h";
				}
			}
		});
		btn_bqc_ff.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bqc_ff.isSelected() == true) {
					btn_bqc_ff.setSelected(false);
					childDTO.hhtzzq3 = childDTO.hhtzzq3.replace("i", "");
				} else {
					btn_bqc_ff.setSelected(true);
					childDTO.hhtzzq3 += "i";
				}
			}
		});

		btn_zjq0.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq0.isSelected() == true) {
					btn_zjq0.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("0", "");
				} else {
					btn_zjq0.setSelected(true);
					childDTO.hhtzzq4 += "0";
				}
			}
		});
		btn_zjq1.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq1.isSelected() == true) {
					btn_zjq1.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("1", "");
				} else {
					btn_zjq1.setSelected(true);
					childDTO.hhtzzq4 += "1";
				}
			}
		});
		btn_zjq2.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq2.isSelected() == true) {
					btn_zjq2.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("2", "");
				} else {
					btn_zjq2.setSelected(true);
					childDTO.hhtzzq4 += "2";
				}
			}
		});
		btn_zjq3.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq3.isSelected() == true) {
					btn_zjq3.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("3", "");
				} else {
					btn_zjq3.setSelected(true);
					childDTO.hhtzzq4 += "3";
				}
			}
		});
		btn_zjq4.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq4.isSelected() == true) {
					btn_zjq4.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("4", "");
				} else {
					btn_zjq4.setSelected(true);
					childDTO.hhtzzq4 += "4";
				}
			}
		});
		btn_zjq5.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq5.isSelected() == true) {
					btn_zjq5.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("5", "");
				} else {
					btn_zjq5.setSelected(true);
					childDTO.hhtzzq4 += "5";
				}
			}
		});

		btn_zjq6.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq6.isSelected() == true) {
					btn_zjq6.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("6", "");
				} else {
					btn_zjq6.setSelected(true);
					childDTO.hhtzzq4 += "6";
				}
			}
		});

		btn_zjq7.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_zjq7.isSelected() == true) {
					btn_zjq7.setSelected(false);
					childDTO.hhtzzq4 = childDTO.hhtzzq4.replace("7", "");
				} else {
					btn_zjq7.setSelected(true);
					childDTO.hhtzzq4 += "7";
				}
			}
		});

		btn_bf_s10.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s10.isSelected() == true) {
					btn_bf_s10.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("a", "");
				} else {
					btn_bf_s10.setSelected(true);
					childDTO.hhtzzq5 += "a";
				}
			}
		});
		btn_bf_s20.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s20.isSelected() == true) {
					btn_bf_s20.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("b", "");
				} else {
					btn_bf_s20.setSelected(true);
					childDTO.hhtzzq5 += "b";
				}
			}
		});
		btn_bf_s21.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s21.isSelected() == true) {
					btn_bf_s21.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("c", "");
				} else {
					btn_bf_s21.setSelected(true);
					childDTO.hhtzzq5 += "c";
				}
			}
		});
		btn_bf_s30.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s30.isSelected() == true) {
					btn_bf_s30.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("d", "");
				} else {
					btn_bf_s30.setSelected(true);
					childDTO.hhtzzq5 += "d";
				}
			}
		});
		btn_bf_s31.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s31.isSelected() == true) {
					btn_bf_s31.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("e", "");
				} else {
					btn_bf_s31.setSelected(true);
					childDTO.hhtzzq5 += "e";
				}
			}
		});
		btn_bf_s32.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s32.isSelected() == true) {
					btn_bf_s32.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("f", "");
				} else {
					btn_bf_s32.setSelected(true);
					childDTO.hhtzzq5 += "f";
				}
			}
		});

		btn_bf_s40.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s40.isSelected() == true) {
					btn_bf_s40.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("g", "");
				} else {
					btn_bf_s40.setSelected(true);
					childDTO.hhtzzq5 += "g";
				}
			}
		});
		btn_bf_s41.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s41.isSelected() == true) {
					btn_bf_s41.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("h", "");
				} else {
					btn_bf_s41.setSelected(true);
					childDTO.hhtzzq5 += "h";
				}
			}
		});
		btn_bf_s42.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s42.isSelected() == true) {
					btn_bf_s42.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("i", "");
				} else {
					btn_bf_s42.setSelected(true);
					childDTO.hhtzzq5 += "i";
				}
			}
		});

		btn_bf_s50.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s50.isSelected() == true) {
					btn_bf_s50.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("j", "");
				} else {
					btn_bf_s50.setSelected(true);
					childDTO.hhtzzq5 += "j";
				}
			}
		});
		btn_bf_s51.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s51.isSelected() == true) {
					btn_bf_s51.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("k", "");
				} else {
					btn_bf_s51.setSelected(true);
					childDTO.hhtzzq5 += "k";
				}
			}
		});
		btn_bf_s52.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_s52.isSelected() == true) {
					btn_bf_s52.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("l", "");
				} else {
					btn_bf_s52.setSelected(true);
					childDTO.hhtzzq5 += "l";
				}
			}
		});

		btn_bf_sqt.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_sqt.isSelected() == true) {
					btn_bf_sqt.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("m", "");
				} else {
					btn_bf_sqt.setSelected(true);
					childDTO.hhtzzq5 += "m";
				}
			}
		});

		btn_bf_p00.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_p00.isSelected() == true) {
					btn_bf_p00.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("n", "");
				} else {
					btn_bf_p00.setSelected(true);
					childDTO.hhtzzq5 += "n";
				}
			}
		});

		btn_bf_p11.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_p11.isSelected() == true) {
					btn_bf_p11.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("o", "");
				} else {
					btn_bf_p11.setSelected(true);
					childDTO.hhtzzq5 += "o";
				}
			}
		});
		btn_bf_p22.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_p22.isSelected() == true) {
					btn_bf_p22.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("p", "");
				} else {
					btn_bf_p22.setSelected(true);
					childDTO.hhtzzq5 += "p";
				}
			}
		});
		btn_bf_p33.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_p33.isSelected() == true) {
					btn_bf_p33.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("q", "");
				} else {
					btn_bf_p33.setSelected(true);
					childDTO.hhtzzq5 += "q";
				}
			}
		});

		btn_bf_pqt.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_pqt.isSelected() == true) {
					btn_bf_pqt.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("r", "");
				} else {
					btn_bf_pqt.setSelected(true);
					childDTO.hhtzzq5 += "r";
				}
			}
		});

		btn_bf_f01.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f01.isSelected() == true) {
					btn_bf_f01.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("s", "");
				} else {
					btn_bf_f01.setSelected(true);
					childDTO.hhtzzq5 += "s";
				}
			}
		});
		btn_bf_f02.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f02.isSelected() == true) {
					btn_bf_f02.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("t", "");
				} else {
					btn_bf_f02.setSelected(true);
					childDTO.hhtzzq5 += "t";
				}
			}
		});
		btn_bf_f12.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f12.isSelected() == true) {
					btn_bf_f12.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("u", "");
				} else {
					btn_bf_f12.setSelected(true);
					childDTO.hhtzzq5 += "u";
				}
			}
		});
		btn_bf_f03.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f03.isSelected() == true) {
					btn_bf_f03.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("v", "");
				} else {
					btn_bf_f03.setSelected(true);
					childDTO.hhtzzq5 += "v";
				}
			}
		});
		btn_bf_f13.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f13.isSelected() == true) {
					btn_bf_f13.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("w", "");
				} else {
					btn_bf_f13.setSelected(true);
					childDTO.hhtzzq5 += "w";
				}
			}
		});
		btn_bf_f23.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f23.isSelected() == true) {
					btn_bf_f23.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("x", "");
				} else {
					btn_bf_f23.setSelected(true);
					childDTO.hhtzzq5 += "x";
				}
			}
		});

		btn_bf_f04.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f04.isSelected() == true) {
					btn_bf_f04.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("y", "");
				} else {
					btn_bf_f04.setSelected(true);
					childDTO.hhtzzq5 += "y";
				}
			}
		});
		btn_bf_f14.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f14.isSelected() == true) {
					btn_bf_f14.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("z", "");
				} else {
					btn_bf_f14.setSelected(true);
					childDTO.hhtzzq5 += "z";
				}
			}
		});
		btn_bf_f24.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f24.isSelected() == true) {
					btn_bf_f24.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("1", "");
				} else {
					btn_bf_f24.setSelected(true);
					childDTO.hhtzzq5 += "1";
				}
			}
		});

		btn_bf_f05.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f05.isSelected() == true) {
					btn_bf_f05.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("2", "");
				} else {
					btn_bf_f05.setSelected(true);
					childDTO.hhtzzq5 += "2";
				}
			}
		});
		btn_bf_f15.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f15.isSelected() == true) {
					btn_bf_f15.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("3", "");
				} else {
					btn_bf_f15.setSelected(true);
					childDTO.hhtzzq5 += "3";
				}
			}
		});
		btn_bf_f25.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_f25.isSelected() == true) {
					btn_bf_f25.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("4", "");
				} else {
					btn_bf_f25.setSelected(true);
					childDTO.hhtzzq5 += "4";
				}
			}
		});

		btn_bf_fqt.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				if (btn_bf_fqt.isSelected() == true) {
					btn_bf_fqt.setSelected(false);
					childDTO.hhtzzq5 = childDTO.hhtzzq5.replace("5", "");
				} else {
					btn_bf_fqt.setSelected(true);
					childDTO.hhtzzq5 += "5";
				}
			}
		});

		initBtnStates();

		btn_cancel.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				MyDialog.Builder dialog = new MyDialog.Builder(JczqHhtz.this);
				dialog.setTitle("退出提示");
				dialog.setMessage("退出后您的选项将不会保存，确认继续?");
				dialog.setPositiveButton("确定", new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						// 获得自定义的应用程序BallDTO,初始化
						Intent data = new Intent();
						childDTO.hhtzzq1 = "";
						childDTO.hhtzzq2 = "";
						childDTO.hhtzzq3 = "";
						childDTO.hhtzzq4 = "";
						childDTO.hhtzzq5 = "";
						childDTO.zqhhtzsp = "";
						data.putExtra("info", childDTO);
						data.putExtra("gindex", gInd);
						data.putExtra("cindex", cInd);
						setResult(RESULT_OK, data);
						JczqHhtz.this.finish();
					}
				});
				dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						dialog.cancel();
					}
				});
				dialog.create().show();
			}
		});

		btn_ok.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				
				String sp = "";
				if (btn_spf_zs.isSelected() == true) {
					sp += ("spf," + btn_spf_zs.getTag().toString() + "/");// 1
				}
				if (btn_spf_p.isSelected() == true) {
					sp += ("spf," + btn_spf_p.getTag().toString() + "/");
				}
				if (btn_spf_zf.isSelected() == true) {
					sp += ("spf," + btn_spf_zf.getTag().toString() + "/");
				}
				if (btn_rqspf_zs.isSelected() == true) {
					sp += ("rq," + btn_rqspf_zs.getTag().toString() + "/");
				}
				if (btn_rqspf_p.isSelected() == true) {
					sp += ("rq," + btn_rqspf_p.getTag().toString() + "/");
				}
				if (btn_rqspf_zf.isSelected() == true) {
					sp += ("rq," + btn_rqspf_zf.getTag().toString() + "/");
				}
				if (btn_bqc_ss.isSelected() == true) {
					sp += ("bqc," + btn_bqc_ss.getTag().toString() + "/");
				}
				if (btn_bqc_sp.isSelected() == true) {
					sp += ("bqc," + btn_bqc_sp.getTag().toString() + "/");
				}
				if (btn_bqc_sf.isSelected() == true) {
					sp += ("bqc," + btn_bqc_sf.getTag().toString() + "/");
				}
				if (btn_bqc_ps.isSelected() == true) {
					sp += ("bqc," + btn_bqc_ps.getTag().toString() + "/");
				}
				if (btn_bqc_pp.isSelected() == true) {
					sp += ("bqc," + btn_bqc_pp.getTag().toString() + "/");
				}
				if (btn_bqc_pf.isSelected() == true) {
					sp += ("bqc," + btn_bqc_pf.getTag().toString() + "/");
				}
				if (btn_bqc_fs.isSelected() == true) {
					sp += ("bqc," + btn_bqc_fs.getTag().toString() + "/");
				}
				if (btn_bqc_fp.isSelected() == true) {
					sp += ("bqc," + btn_bqc_fp.getTag().toString() + "/");
				}
				if (btn_bqc_ff.isSelected() == true) {
					sp += ("bqc," + btn_bqc_ff.getTag().toString() + "/");
				}

				if (btn_zjq0.isSelected() == true) {
					sp += ("zjq0," + btn_zjq0.getTag().toString() + "/");
				}
				if (btn_zjq1.isSelected() == true) {
					sp += ("zjq1," + btn_zjq1.getTag().toString() + "/");
				}
				if (btn_zjq2.isSelected() == true) {
					sp += ("zjq2," + btn_zjq2.getTag().toString() + "/");
				}
				if (btn_zjq3.isSelected() == true) {
					sp += ("zjq3," + btn_zjq3.getTag().toString() + "/");
				}
				if (btn_zjq4.isSelected() == true) {
					sp += ("zjq4," + btn_zjq4.getTag().toString() + "/");
				}
				if (btn_zjq5.isSelected() == true) {
					sp += ("zjq5," + btn_zjq5.getTag().toString() + "/");
				}
				if (btn_zjq6.isSelected() == true) {
					sp += ("zjq6," + btn_zjq6.getTag().toString() + "/");
				}
				if (btn_zjq7.isSelected() == true) {
					sp += ("zjq7," + btn_zjq7.getTag().toString() + "/");
				}
				if (btn_bf_s10.isSelected() == true) {
					sp += ("bf," + btn_bf_s10.getTag().toString() + "/");
				}
				if (btn_bf_s20.isSelected() == true) {
					sp += ("bf," + btn_bf_s20.getTag().toString() + "/");
				}
				if (btn_bf_s21.isSelected() == true) {
					sp += ("bf," + btn_bf_s21.getTag().toString() + "/");
				}
				if (btn_bf_s30.isSelected() == true) {
					sp += ("bf," + btn_bf_s30.getTag().toString() + "/");
				}
				if (btn_bf_s31.isSelected() == true) {
					sp += ("bf," + btn_bf_s31.getTag().toString() + "/");
				}
				if (btn_bf_s32.isSelected() == true) {
					sp += ("bf," + btn_bf_s32.getTag().toString() + "/");
				}
				if (btn_bf_s40.isSelected() == true) {
					sp += ("bf," + btn_bf_s40.getTag().toString() + "/");
				}
				if (btn_bf_s41.isSelected() == true) {
					sp += ("bf," + btn_bf_s41.getTag().toString() + "/");
				}
				if (btn_bf_s42.isSelected() == true) {
					sp += ("bf," + btn_bf_s42.getTag().toString() + "/");
				}
				if (btn_bf_s50.isSelected() == true) {
					sp += ("bf," + btn_bf_s50.getTag().toString() + "/");
				}
				if (btn_bf_s51.isSelected() == true) {
					sp += ("bf," + btn_bf_s51.getTag().toString() + "/");
				}
				if (btn_bf_s52.isSelected() == true) {
					sp += ("bf," + btn_bf_s52.getTag().toString() + "/");
				}
				if (btn_bf_sqt.isSelected() == true) {
					sp += ("bf," + btn_bf_sqt.getTag().toString() + "/");
				}

				if (btn_bf_p00.isSelected() == true) {
					sp += ("bf," + btn_bf_p00.getTag().toString() + "/");
				}
				if (btn_bf_p11.isSelected() == true) {
					sp += ("bf," + btn_bf_p11.getTag().toString() + "/");
				}
				if (btn_bf_p22.isSelected() == true) {
					sp += ("bf," + btn_bf_p22.getTag().toString() + "/");
				}
				if (btn_bf_p33.isSelected() == true) {
					sp += ("bf," + btn_bf_p33.getTag().toString() + "/");
				}
				if (btn_bf_pqt.isSelected() == true) {
					sp += ("bf," + btn_bf_pqt.getTag().toString() + "/");
				}

				if (btn_bf_f01.isSelected() == true) {
					sp += ("bf," + btn_bf_f01.getTag().toString() + "/");
				}
				if (btn_bf_f02.isSelected() == true) {
					sp += ("bf," + btn_bf_f02.getTag().toString() + "/");
				}
				if (btn_bf_f12.isSelected() == true) {
					sp += ("bf," + btn_bf_f12.getTag().toString() + "/");
				}
				if (btn_bf_f03.isSelected() == true) {
					sp += ("bf," + btn_bf_f03.getTag().toString() + "/");
				}
				if (btn_bf_f13.isSelected() == true) {
					sp += ("bf," + btn_bf_f13.getTag().toString() + "/");
				}
				if (btn_bf_f23.isSelected() == true) {
					sp += ("bf," + btn_bf_f23.getTag().toString() + "/");
				}
				if (btn_bf_f04.isSelected() == true) {
					sp += ("bf," + btn_bf_f04.getTag().toString() + "/");
				}
				if (btn_bf_f14.isSelected() == true) {
					sp += ("bf," + btn_bf_f14.getTag().toString() + "/");
				}
				if (btn_bf_f24.isSelected() == true) {
					sp += ("bf," + btn_bf_f24.getTag().toString() + "/");
				}
				if (btn_bf_f05.isSelected() == true) {
					sp += ("bf," + btn_bf_f05.getTag().toString() + "/");
				}
				if (btn_bf_f15.isSelected() == true) {
					sp += ("bf," + btn_bf_f15.getTag().toString() + "/");
				}
				if (btn_bf_f25.isSelected() == true) {
					sp += ("bf," + btn_bf_f25.getTag().toString() + "/");
				}
				if (btn_bf_fqt.isSelected() == true) {
					sp += ("bf," + btn_bf_fqt.getTag().toString() + "/");
				}
				childDTO.zqhhtzsp = sp;

				// Log.v("JczqHhtz", "btn_ok.setOnClickListener sp= " +
				// sp.toString());
				// Log.v("JczqHhtz",
				// "btn_ok.setOnClickListener childDTO.hhtzzq1= " +
				// childDTO.hhtzzq1.toString());
				// Log.v("JczqHhtz",
				// "btn_ok.setOnClickListener childDTO.hhtzzq2= " +
				// childDTO.hhtzzq2.toString());
				// Log.v("JczqHhtz",
				// "btn_ok.setOnClickListener childDTO.hhtzzq3= " +
				// childDTO.hhtzzq3.toString());
				// Log.v("JczqHhtz",
				// "btn_ok.setOnClickListener childDTO.hhtzzq4= " +
				// childDTO.hhtzzq4.toString());
				// Log.v("JczqHhtz",
				// "btn_ok.setOnClickListener childDTO.hhtzzq5= " +
				// childDTO.hhtzzq5.toString());
				// Log.d("JclqHhtz",
				// "btn_ok.setOnClickListener childDTO.getHhtz1()= "+childDTO.getHhtz1().toString());
				// Log.v("JczqHhtz", "btn_ok.setOnClickListener childDTO.mId= "
				// + childDTO.mId.toString());

				Intent data = new Intent();
				data.putExtra("info", childDTO);
				data.putExtra("gindex", gInd);
				data.putExtra("cindex", cInd);
				setResult(RESULT_OK, data);
				JczqHhtz.this.finish();
			}
		});

	}

	public void onResume() {
		super.onResume();
		
	}

	public void onPause() {
		super.onPause();
		
	}

	public void initBtnStates() {
		if (!TextUtils.isEmpty(childDTO.hhtzzq1)) {
			if (childDTO.hhtzzq1.contains("0")) {
				btn_spf_zf.setSelected(true);
			} else {
				btn_spf_zf.setSelected(false);
			}
			if (childDTO.hhtzzq1.contains("1")) {
				btn_spf_p.setSelected(true);
			} else {
				btn_spf_p.setSelected(false);
			}
			if (childDTO.hhtzzq1.contains("3")) {
				btn_spf_zs.setSelected(true);
			} else {
				btn_spf_zs.setSelected(false);
			}
		}
		if (!TextUtils.isEmpty(childDTO.hhtzzq2)) {
			if (childDTO.hhtzzq2.contains("0"))
				btn_rqspf_zf.setSelected(true);
			else
				btn_rqspf_zf.setSelected(false);

			if (childDTO.hhtzzq2.contains("1"))
				btn_rqspf_p.setSelected(true);
			else
				btn_rqspf_p.setSelected(false);

			if (childDTO.hhtzzq2.contains("3"))
				btn_rqspf_zs.setSelected(true);
			else
				btn_rqspf_zs.setSelected(false);
		}
		if (!TextUtils.isEmpty(childDTO.hhtzzq3)) {
			if (childDTO.hhtzzq3.contains("a"))
				btn_bqc_ss.setSelected(true);
			else
				btn_bqc_ss.setSelected(false);
			if (childDTO.hhtzzq3.contains("b"))
				btn_bqc_sp.setSelected(true);
			else
				btn_bqc_sp.setSelected(false);
			if (childDTO.hhtzzq3.contains("c"))
				btn_bqc_sf.setSelected(true);
			else
				btn_bqc_sf.setSelected(false);
			if (childDTO.hhtzzq3.contains("d"))
				btn_bqc_ps.setSelected(true);
			else
				btn_bqc_ps.setSelected(false);
			if (childDTO.hhtzzq3.contains("e"))
				btn_bqc_pp.setSelected(true);
			else
				btn_bqc_pp.setSelected(false);
			if (childDTO.hhtzzq3.contains("f"))
				btn_bqc_pf.setSelected(true);
			else
				btn_bqc_pf.setSelected(false);
			if (childDTO.hhtzzq3.contains("g"))
				btn_bqc_fs.setSelected(true);
			else
				btn_bqc_fs.setSelected(false);
			if (childDTO.hhtzzq3.contains("h"))
				btn_bqc_fp.setSelected(true);
			else
				btn_bqc_fp.setSelected(false);
			if (childDTO.hhtzzq3.contains("i"))
				btn_bqc_ff.setSelected(true);
			else
				btn_bqc_ff.setSelected(false);
		}
		if (!TextUtils.isEmpty(childDTO.hhtzzq4)) {
			if (childDTO.hhtzzq4.contains("0"))
				btn_zjq0.setSelected(true);
			else
				btn_zjq0.setSelected(false);

			if (childDTO.hhtzzq4.contains("1"))
				btn_zjq1.setSelected(true);
			else
				btn_zjq1.setSelected(false);

			if (childDTO.hhtzzq4.contains("2"))
				btn_zjq2.setSelected(true);
			else
				btn_zjq2.setSelected(false);

			if (childDTO.hhtzzq4.contains("3"))
				btn_zjq3.setSelected(true);
			else
				btn_zjq3.setSelected(false);

			if (childDTO.hhtzzq4.contains("4"))
				btn_zjq4.setSelected(true);
			else
				btn_zjq4.setSelected(false);

			if (childDTO.hhtzzq4.contains("5"))
				btn_zjq5.setSelected(true);
			else
				btn_zjq5.setSelected(false);

			if (childDTO.hhtzzq4.contains("6"))
				btn_zjq6.setSelected(true);
			else
				btn_zjq6.setSelected(false);

			if (childDTO.hhtzzq4.contains("7"))
				btn_zjq7.setSelected(true);
			else
				btn_zjq7.setSelected(false);
		}

		if (!TextUtils.isEmpty(childDTO.hhtzzq5)) {

			if (childDTO.hhtzzq5.contains("a"))
				btn_bf_s10.setSelected(true);
			else
				btn_bf_s10.setSelected(false);

			if (childDTO.hhtzzq5.contains("b"))
				btn_bf_s20.setSelected(true);
			else
				btn_bf_s20.setSelected(false);

			if (childDTO.hhtzzq5.contains("c"))
				btn_bf_s21.setSelected(true);
			else
				btn_bf_s21.setSelected(false);

			if (childDTO.hhtzzq5.contains("d"))
				btn_bf_s30.setSelected(true);
			else
				btn_bf_s30.setSelected(false);

			if (childDTO.hhtzzq5.contains("e"))
				btn_bf_s31.setSelected(true);
			else
				btn_bf_s31.setSelected(false);
			if (childDTO.hhtzzq5.contains("f"))
				btn_bf_s32.setSelected(true);
			else
				btn_bf_s32.setSelected(false);
			if (childDTO.hhtzzq5.contains("g"))
				btn_bf_s40.setSelected(true);
			else
				btn_bf_s40.setSelected(false);

			if (childDTO.hhtzzq5.contains("h"))
				btn_bf_s41.setSelected(true);
			else
				btn_bf_s41.setSelected(false);
			if (childDTO.hhtzzq5.contains("i"))
				btn_bf_s42.setSelected(true);
			else
				btn_bf_s42.setSelected(false);
			if (childDTO.hhtzzq5.contains("j"))
				btn_bf_s50.setSelected(true);
			else
				btn_bf_s50.setSelected(false);

			if (childDTO.hhtzzq5.contains("k"))
				btn_bf_s51.setSelected(true);
			else
				btn_bf_s51.setSelected(false);
			if (childDTO.hhtzzq5.contains("l"))
				btn_bf_s52.setSelected(true);
			else
				btn_bf_s52.setSelected(false);
			if (childDTO.hhtzzq5.contains("m"))
				btn_bf_sqt.setSelected(true);
			else
				btn_bf_sqt.setSelected(false);

			if (childDTO.hhtzzq5.contains("n"))
				btn_bf_p00.setSelected(true);
			else
				btn_bf_p00.setSelected(false);
			if (childDTO.hhtzzq5.contains("o"))
				btn_bf_p11.setSelected(true);
			else
				btn_bf_p11.setSelected(false);

			if (childDTO.hhtzzq5.contains("p"))
				btn_bf_p22.setSelected(true);
			else
				btn_bf_p22.setSelected(false);
			if (childDTO.hhtzzq5.contains("q"))
				btn_bf_p33.setSelected(true);
			else
				btn_bf_p33.setSelected(false);
			if (childDTO.hhtzzq5.contains("r"))
				btn_bf_pqt.setSelected(true);
			else
				btn_bf_pqt.setSelected(false);

			if (childDTO.hhtzzq5.contains("s"))
				btn_bf_f01.setSelected(true);
			else
				btn_bf_f01.setSelected(false);

			if (childDTO.hhtzzq5.contains("t"))
				btn_bf_f02.setSelected(true);
			else
				btn_bf_f02.setSelected(false);

			if (childDTO.hhtzzq5.contains("u"))
				btn_bf_f12.setSelected(true);
			else
				btn_bf_f12.setSelected(false);

			if (childDTO.hhtzzq5.contains("v"))
				btn_bf_f03.setSelected(true);
			else
				btn_bf_f03.setSelected(false);

			if (childDTO.hhtzzq5.contains("w"))
				btn_bf_f13.setSelected(true);
			else
				btn_bf_f13.setSelected(false);
			if (childDTO.hhtzzq5.contains("x"))
				btn_bf_f23.setSelected(true);
			else
				btn_bf_f23.setSelected(false);
			if (childDTO.hhtzzq5.contains("y"))
				btn_bf_f04.setSelected(true);
			else
				btn_bf_f04.setSelected(false);

			if (childDTO.hhtzzq5.contains("z"))
				btn_bf_f14.setSelected(true);
			else
				btn_bf_f14.setSelected(false);
			if (childDTO.hhtzzq5.contains("1"))
				btn_bf_f24.setSelected(true);
			else
				btn_bf_f24.setSelected(false);
			if (childDTO.hhtzzq5.contains("2"))
				btn_bf_f05.setSelected(true);
			else
				btn_bf_f05.setSelected(false);

			if (childDTO.hhtzzq5.contains("3"))
				btn_bf_f15.setSelected(true);
			else
				btn_bf_f15.setSelected(false);
			if (childDTO.hhtzzq5.contains("4"))
				btn_bf_f25.setSelected(true);
			else
				btn_bf_f25.setSelected(false);
			if (childDTO.hhtzzq5.contains("5"))
				btn_bf_fqt.setSelected(true);
			else
				btn_bf_fqt.setSelected(false);
		}

	}

	@Override
	public void finish() {
		
		super.finish();
	};

	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			MyDialog.Builder dialog = new MyDialog.Builder(JczqHhtz.this);
			dialog.setTitle("退出提示");
			dialog.setMessage("退出后您的选项将不会保存，确认继续?");
			dialog.setPositiveButton("确定", new DialogInterface.OnClickListener() {
				@Override
				public void onClick(DialogInterface dialog, int which) {
					// 获得自定义的应用程序BallDTO,初始化
					Intent data = new Intent();
					childDTO.hhtzzq1 = "";
					childDTO.hhtzzq2 = "";
					childDTO.hhtzzq3 = "";
					childDTO.hhtzzq4 = "";
					childDTO.hhtzzq5 = "";
					childDTO.zqhhtzsp = "";
					data.putExtra("info", childDTO);
					data.putExtra("gindex", gInd);
					data.putExtra("cindex", cInd);
					setResult(RESULT_OK, data);
					JczqHhtz.this.finish();
					dialog.cancel();
				}
			});
			dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
				@Override
				public void onClick(DialogInterface dialog, int which) {
					dialog.cancel();
				}
			}).create().show();
		} else {
			return super.onKeyDown(keyCode, event);
		}
		return true;
	}
}
